package com.study.cloud.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Component
@FeignClient(value = "CLOUD-PROVIDER-HYSTRIX-PAYMENT", fallback = PaymentFallbackService.class) //服务降级
public interface PaymentHystrixService {

    @RequestMapping(value = "/payment/hystrix/ok/{id}", method = RequestMethod.GET)
    String paymentInfo_ok(@PathVariable("id") Integer id);


    @RequestMapping(value = "/payment/hystrix/error/{id}", method = RequestMethod.GET)
    String paymentInfo_error(@PathVariable("id") Integer id);
}
